package com.owulia.coffee.commons.config;

import com.owulia.coffee.commons.converter.redis.BytesToMoneyConverter;
import com.owulia.coffee.commons.converter.redis.MoneyToBytesConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.convert.RedisCustomConversions;

import java.util.Arrays;

/**
 * redis 转换类注入
 */
@Configuration
public class ConfigRedis {

    @Bean
    public RedisCustomConversions redisCustomConversions() {
        return new RedisCustomConversions(
                Arrays.asList(new MoneyToBytesConverter(), new BytesToMoneyConverter()));
    }
}
